package com.kuangstudy.io.filter;

import java.io.File;
import java.io.FileFilter;

/**
 * ClassName: FileFilterImpl
 * date: 2021/07/16 10:49:34
 *创建过滤器FileFilter的实现类，重写过滤方法accept，定义过滤规则
 * @author zlk
 */
public class FileFilterImpl implements FileFilter {
    @Override
    public boolean accept(File pathname) {
        if (pathname.isDirectory()){
            return true;
        }
        return pathname.getName().toLowerCase().endsWith("txt");
    }
}
